//公共底部
import Tabbar from '/pages/headerfoot/pages/hitgamefooter.vue'
// 公共头部
import myHeader from "/pages/headerfoot/pages/header.vue";
// 公告
import uninoticeBar from "/uni_modules/uni-notice-bar/components/uni-notice-bar/uni-notice-bar.vue";
//打帮赛方法
import hitmatchcommon from '@/common/hitmatchcommon.js';
//骨架
import uniSkeleton from "/plugin/skeleton/components/heaven-skeleton/heaven-skeleton.vue";
//语言
import Langmatch from '@/utils/langmatch.js';
//cache缓存
import Cache from '@/utils/cache.js';
//公共配置
import App from '@/config/app.js';

export default {
	components: {
		Tabbar,
		myHeader,
		uninoticeBar,
		uniSkeleton,
	},
	data() {
		return {
			indicatorDots: true,
			autoplay: true, //自动播放
			interval: 2000, //自动切换时间间隔
			duration: 500, //滑动动画时长
			loading: true, //骨架加载显示
			lang: Langmatch.lang, //语言
			banner:[],//banner
			notices:[],//通知
			nearMake:[],//最近项目
		}
	},
	onShow() {
	
	},
	//获取参数1
	onLoad(opetion){
		//有推荐人
		if(opetion.id){
			Cache.set('referrerid',opetion.id,App.EXPIRE);
	    }
		var that = this;
		//获取用户
		that.getUser();
		
		that.gethomeinfo();
	},
	// 1.发送给朋友
	onShareAppMessage() {
		return {
			title: "打榜赛",
			path: "/pages/hitgame/pages/hitgameindex?id=1",
			imageUrl: 'https://www.iiscchina.com/wp-content/uploads/2023/07/qtmf.png',
		}
	},
	methods: {
	
		//获取用户
		async getUser(){
				var that=this;
				var data={};
				data['openid']=Cache.get('user_openid');
				hitmatchcommon.getUserLibMethod(data).then(res => {});
		},
		
		//获取方法
		async gethomeinfo(){
			var that = this;
			var data = {};
			hitmatchcommon.getindexdatLibMethod(data).then(res => {
				if (res) {
				    that.banner=res.banners;//banner赋值
					that.notices=res.notices[0]['title'];//通知赋值
					that.nearMake=res.nearMake;//最近项目
					that.loading = false; //骨架加载隐藏
				}
			});
		},
	
	},


}